package com.sunny.ynhz.ui;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.sunny.ynhz.R;
import com.sunny.ynhz.adapter.base.ViewPageFragmentAdapter;
import com.sunny.ynhz.ui.base.AppBaseTitleBarActivity;
import com.sunny.ynhz.ui.lake.PatrolBasinRiverProblemFragment;
import com.sunny.ynhz.ui.lake.PatrolBasinRiverRouteFragment;
import com.sunny.ynhz.ui.lake.PatrolRiverProblemFragment;
import com.sunny.ynhz.ui.lake.PatrolRiverRouteFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by huhuan123 on 2018/6/11.
 */

public class RedRiverMsgActivity extends AppBaseTitleBarActivity {

    private ViewPager viewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.patrol_river_fragment);
        viewPager = findViewById(R.id.vp_patrol_river);
        setTitle("红河流域");
        TabLayout mTabLayout =findViewById(R.id.tab_title);
        mTabLayout.setupWithViewPager(viewPager);
        PatrolBasinRiverProblemFragment patrolRiverProblemFragment = new PatrolBasinRiverProblemFragment();
        Bundle bundle = new Bundle();
        bundle.putString("type", "1");
        patrolRiverProblemFragment.setArguments(bundle);
        PatrolBasinRiverRouteFragment patrolRiverRouteFragment = new PatrolBasinRiverRouteFragment();
        Bundle bundlepatrolRiverRouteFragment = new Bundle();
        bundlepatrolRiverRouteFragment.putString("type", "1");
        patrolRiverRouteFragment.setArguments(bundlepatrolRiverRouteFragment);
        List<Fragment> list = new ArrayList<>();
        list.add(patrolRiverProblemFragment);
        list.add(patrolRiverRouteFragment);
        ViewPageFragmentAdapter viewPageFragmentAdapter = new ViewPageFragmentAdapter(getSupportFragmentManager(), list,new String[]{"巡河问题","巡河轨迹"});
        viewPager.setAdapter(viewPageFragmentAdapter);
    }
}
